package com.fanghuaman.util.localthread;

import com.fanghuaman.model.user.pojo.User;

/**
 * @author shiminghui
 * @date 2024/12/21 19:18
 * @description: TODO
 */
public class UserLocalThread {
    private static final ThreadLocal<User> USER_THREAD_LOCAL = new ThreadLocal<>();

    public static User getUser() {
        return USER_THREAD_LOCAL.get();
    }

    public static void setUser(User user) {
        USER_THREAD_LOCAL.set(user);
    }

    public static void remove() {
        USER_THREAD_LOCAL.remove();
    }
}
